﻿Public Partial Class _Default
    Inherits CoreClass

    Private Sub Page_Load1(ByVal sender As Object, ByVal e As System.EventArgs) Handles Me.Load
        Try
            If Not Page.IsPostBack Then
                loadDashBoard()
            End If
        Catch ex As Exception
            Response.Redirect("/Inside/xLogin.aspx?redirect=" & Request.Url.PathAndQuery.Replace("?", "|"))
        End Try
    End Sub

    ' Get dữ liệu 
    Private Sub loadDashBoard()
        Try
            
            sql = "spi_DashBoard "
            objData.ExeReader(sql)
            If objData.dataRead.Read Then
                lblBillLock.Text = objData.dataRead("BillWait").ToString()
                lblBillAccept.Text = objData.dataRead("BillAccept").ToString()
                lblBillPay.Text = objData.dataRead("BillDelivery").ToString()

                lblCusLock.Text = objData.dataRead("CusWait").ToString()
                lblCusAccept.Text = objData.dataRead("CusAccept").ToString()

                lblProLock.Text = objData.dataRead("ProWait").ToString()
                lblProAccept.Text = objData.dataRead("ProAccept").ToString()
                lblProRecycle.Text = objData.dataRead("ProDelete").ToString()

                lblNewLock.Text = objData.dataRead("NewWait").ToString()
                lblNewAccept.Text = objData.dataRead("NewAccept").ToString()
                lblNewRecycle.Text = objData.dataRead("NewDelete").ToString()

                lblContactWait.Text = objData.dataRead("ContactWait").ToString()
                lblContactAccept.Text = objData.dataRead("ContactAccept").ToString()

            End If
        Catch ex As Exception
            If objConfig.Developer.Equals("1") Then
                objAlert.ErrorBox(Page, "File: " & (New System.Diagnostics.StackTrace).GetFrame(0).GetMethod.DeclaringType.Name & _
                                  " --- Function: " & (New System.Diagnostics.StackTrace).GetFrame(0).GetMethod.Name & _
                                  " --- Mess: " & ex.Message.Replace("'", """"))
            Else
                objAlert.ErrorBox(Page, "Lỗi kỹ thuật, hãy thông báo lại với Admin, xin cảm ơn.")
            End If
        End Try
    End Sub
End Class